Safezone Teleport -
FrostedVince - 15.07.2010
Hello there, well, I started scripting a safezone, mapped everything etc.
But now, i am getting the following errors, and yes, i'm kind of new to strings and to pawn, more specificly.
Here is the code:
pawn Код:
if (strcmp("/enter", cmdtext, true, 10) == 0)
{
if(PlayerToPoint(50.0,playerid,-1233.5388,-2331.3735,18.2380))
{
new string[128];
SetPlayerPos(playerid,2263.7610,-2323.9080,323.6542);
SendClientMessageToAll(COLOR_WHITE, "%s has entered the safezone!",playerid);
return 1;
}
else if(classid == 0)
{
SendClientMessage(playerid,COLOR_RED, "-Access Denied-");
return 1;
}
else
{
SendClientMessage(playerid,COLOR_LIGHTBLUE, "You are not at the safezone! Be careful!");
return 1;
}
}
I am getting the following errors/warnings:
Код:
C:\Users\vince\Desktop\Project Zombie\gamemodes\pzombie.pwn(302) : error 004: function "PlayerToPoint" is not implemented
C:\Users\vince\Desktop\Project Zombie\gamemodes\pzombie.pwn(306) : warning 202: number of arguments does not match definition
C:\Users\vince\Desktop\Project Zombie\gamemodes\pzombie.pwn(304) : warning 204: symbol is assigned a value that is never used: "string"
C:\Users\vince\Desktop\Project Zombie\gamemodes\pzombie.pwn(304 -- 309) : error 017: undefined symbol "classid"
For the class id's, here are they:
pawn Код:
if(classid == 0)
{
GameTextForPlayer(playerid, "[ Zombie ]",500,3);
}
else if(classid == 1)
{
GameTextForPlayer(playerid, "[ Shine ]",500,3);
}
else if(classid == 2)
{
GameTextForPlayer(playerid, "[ Turok ]",500,3);
}
else if(classid == 3)
{
GameTextForPlayer(playerid, "[ Hankron ]",500,3);
}
else if(classid == 4)
{
GameTextForPlayer(playerid, "[ Chesty ]",500,3);
}
else if(classid == 5)
{
GameTextForPlayer(playerid, "[ Crazy Tom ]",500,3);
}
And for if(PlayerToPoint) i think that I included it by doing this:
pawn Код:
forward PlayerToPoint(Float:radi, playerid, Float:x, Float:y, Float:z);
Thanks in advance!
Signed, Vince.
Re: Safezone Teleport -
cessil - 15.07.2010
use IsPlayerInRangeOfPoint instead of PlayerToPoint
you need to format a string before sending it if it has dynamics in it like playerid
SendClientMessageToAll(COLOR_WHITE, "%s has entered the safezone!",playerid);
should be
format(string,sizeof(string),"%s has entered the safezone!",playerid);
SendClientMessageToAll(COLOR_WHITE,string);
and when you use this...
else if(classid == 0)
classid isn't defined, either define it or use something else, I think you want GetPlayerSkin
EDIT:
on the class selection part add a variable so zombies = 0, shine will be 1 ect. like this
pawn Код:
else if(classid == 4)
{
GameTextForPlayer(playerid, "[ Chesty ]",500,3);
SetPVarInt(playerid,"classid",4);
}
this use GetPVarInt(playerid,"classid") to check it