21.05.2010, 09:32
i have a problem. my admins cmds goto and bring didnt work. here is the code
/goto
/bring
pls help!!!!!!!!!!!!!!!!!!!!!!!!! 
also how can i make to show some random msg's while the player is in the server for example: we have houses on the server earn money to buy one.
/goto
Код:
if(strcmp(cmd, "/goto", true) == 0 && PlayerAdminLevel[playerid] == 1337) // Teleports Admin To A Player
{
tmp = strtok(cmdtext, idx);
if(!strlen(tmp)) {
SendClientMessage(playerid, COLOR_ERROR, "USAGE: /goto (id)");
return 1;
}
giveplayerid = strval(tmp);
if(!IsNumeric(tmp)) {
SendClientMessage(playerid, COLOR_ERROR, "USAGE: /goto (id) ID Must be a number");
return 1;
}
if (IsPlayerConnected(giveplayerid)) {
SetPlayerInterior(playerid, GetPlayerInterior(giveplayerid));
new Float:x, Float:y, Float:z;
new pname[24];
new aname[24];
GetPlayerPos(giveplayerid, x,y,z);
SetPlayerPos(playerid, x+1,y,z);
GetPlayerName(giveplayerid, pname, 24);
GetPlayerName(playerid, aname, 24);
SendClientMessage(playerid, 0xA9A9A9AA, "|_Admin Command Used_|");
format(string, sizeof(string), "You have teleported to %s(%d)",pname,giveplayerid);
SendClientMessage(playerid,0xFF7F50AA, string);
format(string, sizeof(string), "%s(%d) has teleported to %s(%d) [ADMIN COMMAND /GOTO]",aname,playerid,pname,giveplayerid);
printf("%s", string);
}
else {
format(string, sizeof(string), "ID (%d) Is not an active player", giveplayerid);
SendClientMessage(playerid, COLOR_ERROR, string);
}
return 1;
}
Код:
if(strcmp(cmd, "/bring", true) == 0 && PlayerAdminLevel[playerid] == 1337) // Brings A Player To Admin
{
tmp = strtok(cmdtext, idx);
if(!strlen(tmp)) {
SendClientMessage(playerid, COLOR_ERROR, "USAGE: /bring (id)");
return 1;
}
giveplayerid = strval(tmp);
if(!IsNumeric(tmp)) {
SendClientMessage(playerid, COLOR_ERROR, "USAGE: /bring (id) ID Must be a number");
return 1;
}
if (IsPlayerConnected(giveplayerid)) {
SetPlayerInterior(giveplayerid, GetPlayerInterior(playerid));
new Float:x, Float:y, Float:z;
new pname[24];
new aname[24];
GetPlayerPos(playerid, x,y,z);
SetPlayerPos(giveplayerid, x+1,y,z);
SetPlayerVirtualWorld(giveplayerid,GetPlayerVirtualWorld(playerid));
GetPlayerName(giveplayerid, pname, 24);
GetPlayerName(playerid, aname, 24);
SendClientMessage(playerid, 0xA9A9A9AA, "|_Admin Command Used_|");
format(string, sizeof(string), "You have brought (teleported) %s(%d) to you",pname,giveplayerid);
SendClientMessage(playerid,0xFF7F50AA, string);
format(string, sizeof(string), "%s(%d) has brought (teleported) %s(%d) [ADMIN COMMAND /BRING]",aname,playerid,pname,giveplayerid);
printf("%s", string);
}
else {
format(string, sizeof(string), "ID (%d) Is not an active player", giveplayerid);
SendClientMessage(playerid, COLOR_ERROR, string);
}
return 1;
}

also how can i make to show some random msg's while the player is in the server for example: we have houses on the server earn money to buy one.

