29.05.2016, 01:42
Hello.
Use zcmd & sscanf2. This is better and faster than "OnPlayerText".
When you have download those. Your command should be:
Use zcmd & sscanf2. This is better and faster than "OnPlayerText".
When you have download those. Your command should be:
PHP код:
CMD:goto(playerid, params[])
{
new place[6];
if(sscanf(params, "s[5]", place)) return SendClientMessage(playerid, -1, "[USE] /goto [SF/LV/LS]");
/*
- If the player doesn't add any parameters so we send a message to show what parameter is waiting (here we use return to end the command).
*/
if(!strcmp(place, "SF")) // We compare two strings : place (should be SF here) and "SF". If both strings are the same ("!") so we execute the code.
{
//Set the positions for SF
return 1; // return 1 to end the command. 1 mean the command didn't fail
}
if(!strcmp(place, "LS")) // We compare two strings : place (should be LS here) and "LS". If both strings are the same ("!") so we execute the code.
{
//Set the pos for LS
return 1;
}
if(!strcmp(place, "LV")) // We compare two strings : place (should be LV here) and "LV". If both strings are the same ("!") so we execute the code.
{
//Set the pos for LV
return 1;
}
else return SendClientMessage(playerid, -1, "This place doesn't exist"); // If the player put a parameter which is not SF/LV/LS so return an error message and the command end here.
//SetPlayerPos(playerid, -1855.73853, -1692.89526, 42.66900); I didn't delete this but you have to move it.
}