16.03.2011, 23:54
Okay, I made a warp command so that if I type /warp [Playerid] [location] it will warp that player to that location
So far I made two different locations, SFPD, and SFES.
I was wondering how I can fix this, as I get some errors
Yes I have added new text;
And Im pretty sure I didn't do this right anyways
So far I made two different locations, SFPD, and SFES.
I was wondering how I can fix this, as I get some errors
pawn Код:
command(warp, playerid, params[])
{
new id, Names[2][MAX_PLAYER_NAME];
if(sscanf(params, "u", id)) {
if(Player[playerid][AdminLevel] >= 1) {
SendClientMessage(playerid, WHITE, "SYNTAX: /warp [playerid] [Location]");
}
}
else {
if(Player[playerid][AdminLevel] >= 1) {
if(IsPlayerConnected(id)) {
GetPlayerName(id, Names[0], MAX_PLAYER_NAME);
GetPlayerName(playerid, Names[1], MAX_PLAYER_NAME);
new string[128];
if(!strcmp(text, "PD", true)) {
format(string, sizeof(string), "You have warped %s to the Police Department.", GetName(id));
SendClientMessage(playerid, WHITE, string);
SetPlayerPos(playerid, Groups[1][HQExteriorX], Groups[1][HQExteriorY], Groups[1][HQExteriorZ]);
SetPlayerVirtualWorld(playerid, SpawnWorld);
SetPlayerInterior(playerid, Groups[1][HQExteriorID]);
format(string, sizeof(string), "%s has admin-warped you to the Police Department.", GetName(playerid));
SendClientMessage(id, WHITE, string);
TextDrawHideForPlayer(id, ExitTextdraw);
format(string, sizeof(string), "%s has been warped to the Police Department by %s.", Names[0], Names[1]);
AdminActionsLog(string);
}
else if(!strcmp(text, "Hospital", true)) {
format(string, sizeof(string), "You have warped %s to the Hospital.", GetName(id));
SendClientMessage(playerid, WHITE, string);
SetPlayerPos(playerid, Groups[4][HQExteriorX], Groups[4][HQExteriorY], Groups[4][HQExteriorZ]);
SetPlayerVirtualWorld(playerid, SpawnWorld);
SetPlayerInterior(playerid, Groups[4][HQExteriorID]);
format(string, sizeof(string), "%s has admin-warped you to the Hospital.", GetName(playerid));
SendClientMessage(id, WHITE, string);
TextDrawHideForPlayer(id, ExitTextdraw);
format(string, sizeof(string), "%s has been warped to the Hospital by %s.", Names[0], Names[1]);
AdminActionsLog(string);
}
}
else {
SendClientMessage(playerid, WHITE, "That player is not connected.");
}
}
}
return 1;
}
Код:
C:\Users\Brandona_2\Desktop\Carnage Roleplay\gamemodes\VortexRoleplay.pwn(11481) : error 017: undefined symbol "text" C:\Users\Brandona_2\Desktop\Carnage Roleplay\gamemodes\VortexRoleplay.pwn(11495) : error 017: undefined symbol "text" Pawn compiler 3.2.3664 Copyright © 1997-2006, ITB CompuPhase 2 Errors.
Код:
Line 11481: if(!strcmp(text, "PD", true)) { Line 11495: else if(!strcmp(text, "Hospital", true)) {
And Im pretty sure I didn't do this right anyways