Whats the right way to do it? - Printable Version
+- SA-MP Forums Archive (
https://sampforum.blast.hk)
+-- Forum: SA-MP Scripting and Plugins (
https://sampforum.blast.hk/forumdisplay.php?fid=8)
+--- Forum: Scripting Help (
https://sampforum.blast.hk/forumdisplay.php?fid=12)
+--- Thread: Whats the right way to do it? (
/showthread.php?tid=622900)
Whats the right way to do it? -
maikons - 27.11.2016
Whats the right way to do it i trying to do in only one line:
PHP код:
else if(vid >= 133 && vid <= 142) { if(org[playerid] != 7) return DontHaveKeys(playerid, "BALLAS"); }
PHP код:
error 035: argument type mismatch (argument 2)
To
PHP код:
forward DontHaveKeys(playerid, keysownersname); public DontHaveKeys(playerid, keysownersname) {
new string[80];
format(string, sizeof(string), "You are not a %s so you cant turn on this car", keysownersname );
SendClientMessage(playerid, -1, string);
return 1;
}
Re: Whats the right way to do it? -
Alvitr - 27.11.2016
answer is here
https://sampwiki.blast.hk/wiki/Keywords:...lisers#forward
PHP код:
forward MyPublicFunction(playerid, const string[]);
public MyPublicFunction(playerid, const string[])
{
}
Re: Whats the right way to do it? -
Dayrion - 27.11.2016
Quote:
Originally Posted by maikons
Whats the right way to do it i trying to do in only one line:
PHP код:
else if(vid >= 133 && vid <= 142) { if(org[playerid] != 7) return DontHaveKeys(playerid, "BALLAS"); }
PHP код:
error 035: argument type mismatch (argument 2)
To
PHP код:
forward DontHaveKeys(playerid, keysownersname); public DontHaveKeys(playerid, keysownersname) {
new string[80];
format(string, sizeof(string), "You are not a %s so you cant turn on this car", keysownersname );
SendClientMessage(playerid, -1, string);
return 1;
}
|
keysownersname is an integer and you put a string.
PHP код:
forward DontHaveKeys(playerid, keysownersname[MAX_PLAYER_NAME]); public DontHaveKeys(playerid, keysownersname[MAX_PLAYER_NAME]) {
new string[80];
format(string, sizeof(string), "You are not a %s so you cant turn on this car", keysownersname );
SendClientMessage(playerid, -1, string);
return 1;
}
Re: Whats the right way to do it? -
maikons - 27.11.2016
Thank you guys +rep