09.06.2009, 21:52
I've made a /tie command now but if I do /tie 12 (for example) it ties myself and not the id I typed.
pawn Код:
if(strcmp(cmd, "/tie", true) == 0)
{
if(IsPlayerConnected(playerid))
{
tmp = strtok(cmdtext, idx);
if(!strlen(tmp))
{
SendClientMessage(playerid, COLOR_YELLOW, "USAGE: /tie [player id]");
return 1;
}
TogglePlayerControllable(playerid, 0);
}
return 1;
}
//--------------------------------------------------------------------------------------------------------------
if(strcmp(cmd, "/untie", true) == 0)
{
if(IsPlayerConnected(playerid))
{
tmp = strtok(cmdtext, idx);
if(!strlen(tmp))
{
SendClientMessage(playerid, COLOR_YELLOW, "USAGE: /tie [player id]");
return 1;
}
TogglePlayerControllable(playerid, 1);
}
return 1;
}