26.11.2011, 20:12
I need to set this to work only for skin ID 280-287:
I tried "if(GetPlayerSkin(playerid) == 280)", but it just throws me the usual 26 errors.
pawn Код:
public OnPlayerCommandText(playerid, cmdtext[])
{
if (strcmp("/spikes", cmdtext, true, 8) == 0)
{
new vehicleid = GetPlayerVehicleID(playerid);
if(vehicleid == 0){
new Float:X, Float:Y, Float:Z, Float:A;
GetPlayerPos(playerid, X, Y, Z);
GetPlayerFacingAngle(playerid, A);
CreateSmallStinger(X+(6.0*floatsin(-A, degrees)), Y+(6.0*floatcos(-A, degrees)), Z-0.825, A, GetPlayerVirtualWorld(playerid), 60000);
}
else{
new Float:X, Float:Y, Float:Z, Float:A;
GetVehiclePos(vehicleid, X, Y, Z);
GetVehicleZAngle(vehicleid, A);
CreateLargeStinger(X-(10.0*floatsin(-A, degrees)), Y-(10.0*floatcos(-A, degrees)), Z-0.325, A, GetPlayerVirtualWorld(playerid), 60000);
}
return 1;
}
if (strcmp("/removespikes", cmdtext, true, 15) == 0)
{
new Float:X, Float:Y, Float:Z;
for(new stingerid = 0; stingerid < sizeof(iPickups); stingerid++){
if(iPickups[stingerid][0] == -1)
continue;
GetObjectPos(iPickups[stingerid][0], X, Y, Z);
if(IsPlayerInRangeOfPoint(playerid, 3.0, X, Y, Z)){
DestroyStinger(stingerid);
break;
}
}
return 1;
}
return 0;
}