help please
#4

I don't exactly get what you're trying to achieve.
This part:
Code:
new string[128];
for(new i = 0; i < MAX_PLAYERS; i ++)
if(IsPlayerInVehicle(i, GetPlayerVehicleID(i)))
SendClientMessage(playerid, COLOR_YELLOW, string);
Won't do anything at all because:
• You create a string and send the player a message using that string, however you never format it or set its text if you will.
• The for loop is absolutely pointless, because in the end you never use the "i". Did you mean to write:
Code:
SendClientMessage(i, COLOR_YELLOW, string);
This part won't work either:
Code:
if (sscanf(params, "u", userid))
return SendSyntaxMessage(playerid, "/cw [text]");
You're trying to ask sscanf to look for a valid playerid (the "u" specifier is wrong), and you are expecting to check if it's a string or not.

Should be:
Code:
new string[128]; //or any size.
if (sscanf(params, "s[128]", string)) return SendSyntaxMessage(playerid, "/cw [text]");
And now, you don't need to redeclare a string.
I think you've got everything to get your code sorted.
Reply


Messages In This Thread
help please - by seventyone - 17.05.2020, 19:46
Re: help please - by Adamoneoone - 17.05.2020, 20:21
Re: help please - by seventyone - 18.05.2020, 07:53
Re: help please - by Adamoneoone - 18.05.2020, 08:17
Re: help please - by Shadow0707 - 18.05.2020, 08:51

Forum Jump:


Users browsing this thread: 1 Guest(s)