Jump to content

okradnout


Recommended Posts

Vím že už tu jedno okr je ,ale nejde zkoušel jsem to....

A pomáhal mi s tím Mirdoslavovic

Takže do OnplayerCommandText

dcmd(okradnout,9,cmdtext);

 

A někam do modu ne do publicu !!

dcmd_okradnout(playerid,params[])
{
new okradeny = strval(params);
new korist = 560+random(200); //to je kolik ukradne + náhodná částka
new string[256];
new id = strval(params);
new prachy=GetPlayerMoney(id);

if(iPlayerRole[playerid] == 9) //proměna povolání
{
if(!strlen(params)) { 
SendClientMessage(playerid, COLOR_RED, "POUŽITÍ /okradnout [id]");
return 1;
}
if(!IsPlayerConnected(playerid)){ 
SendClientMessage(playerid, COLOR_RED, "Špatné [id]");
return 1;
}
if(playerid == id) return  SendClientMessage(playerid,  COLOR_RED, "Sám sebe nemůžeš okradnout!");
printf(string);
if(GetDistanceBetweenPlayers(playerid, id) >= 10) return SCM(playerid,COLOR_RED,"Jsi daleko!"); //Je tu nastaveno min. 10 metrů
if (prachy<1000) return SendClientMessage(playerid, COLOR_RED, "Tento hráč nemá peníze!"); //pokud hráč nemá peníze , nejde ho okradnout
format(string, sizeof(string), "Hráč %s byl okraden Mafiánem %s", PlayerName(id), PlayerName(playerid));
SendClientMessageToAll(0xAA3333AA, string);
SetPlayerWantedLevel(playerid,GetPlayerWantedLevel(playerid)+1); // když okradeš hráče přibyde ti wantedlevel
GivePlayerMoney(okradeny,-korist);
GivePlayerMoney(playerid,korist);

}else{

SendClientMessage(playerid, COLOR_RED, "Nejsi Mafián"); 
}

return 1;
}

Toť vše

Link to comment
Share on other sites

me to nejde

misemi to chibi vif(iPlayerRole[playerid] == 9)

 

C:\Documents and Settings\Já\Plocha\lvdm(2).pwn(2422) : error 017: undefined symbol "iPlayerRole"

C:\Documents and Settings\Já\Plocha\lvdm(2).pwn(2422) : warning 215: expression has no effect

C:\Documents and Settings\Já\Plocha\lvdm(2).pwn(2422) : error 001: expected token: ";", but found "]"

C:\Documents and Settings\Já\Plocha\lvdm(2).pwn(2422) : error 029: invalid expression, assumed zero

C:\Documents and Settings\Já\Plocha\lvdm(2).pwn(2422) : fatal error 107: too many error messages on one line

 

Compilation aborted.Pawn compiler 3.2.3664 Copyright © 1997-2006, ITB CompuPhase

 

 

4 Errors.

Link to comment
Share on other sites

  • 2 weeks later...

mam neco podobneho..

public OnPlayerCommandText

dcmd(okradnout,9,cmdtext);

nekam do modu nejlepe na konec

dcmd_okradnout(playerid,params[])
{
if(IsPlayerConnected(playerid))
{
    new id=strval(params);
    new string[256];
		if(povolani[playerid] == 2 || povolani[playerid] == 3 || povolani[playerid] == 8)
		{//povolani
		if(!params[0]) return SendClientMessage(playerid,COLOR_SYSTEM,"[!] Použití /okradnout [iD]");//kdyz napomene zadat id
		else if(strval(params) == playerid) return SendClientMessage(playerid,COLOR_SYSTEM,"[!] Jak se chcete vydirat?");
		else if(IsPlayerInAnyVehicle(playerid)) return SendClientMessage(playerid,COLOR_SYSTEM,"[!] Nesmíte být v autě");
		else if(!IsPlayerConnected(id)) return SendClientMessage(playerid,COLOR_WHITE,"[!] Hráč není ve hře");
		else if(GetPlayerWeapon(playerid) == 0) return SendClientMessage(playerid,COLOR_SYSTEM, "[!] Musite mit v ruce zbran");
		new Float:xyz[3];
GetPlayerPos(playerid,xyz[0],xyz[1],xyz[2]);
if(!IsPlayerInSphere(id,xyz[0],xyz[1],xyz[2],10))return SendClientMessage(playerid,COLOR_WHITE,"[!]Hráč je moc daleko");			else//splnuje vsechny podminky
		{
		new castka = GetMoney(id)/2;//da mu to polovinu castka ktere ma hrac u sebe (/3 <- tretina /4 <- ctvrtina atd.)
		GiveMoney(playerid,castka);//da prachy zlodeji
		GiveMoney(id,-castka);//odebere okradememu
		new vydira[MAX_PLAYER_NAME], vidiran[MAX_PLAYER_NAME], text[256];//tak tet si zjistime jemno..
GetPlayerName(playerid, vidira, sizeof(vidira));
GetPlayerName(id, vidiran, sizeofvidiran));
format(text, sizeof(text), "[sAPD]Strážce zákona %s zatknul hráče %s",vidira, vidiran);//a pouzijeme v SCM..
SendClientMessageToAll(COLOR_LIGHTBLUE, text);
		SendClientMessageToAll(COLOR_RED2, string);
		ApplyAnimation(id,"ROB_BANK","SHP_HandsUp_Scr",4.1,0,1,1,1,1);//animackaXD
		ApplyAnimation(playerid,"ped", "ARRESTgun",4.1,0,1,1,1,1);//dalsi aby to nebylo tak chude
		}
		}else{
		SendClientMessage(playerid,COLOR_SYSTEM,"[!] Nejste mafian ani terorista");
	}
}
return 1;
}

Link to comment
Share on other sites

  • 1 month later...

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...