CMD:up(playerid,params[])
{
new TargetID, Amount, Float:X,Float:Y,Float:Z;
if(!IsPlayerAdmin(playerid)) return SendClientMessage(playerid,Red,"UnKnown Command! Type /cmds");
if(sscanf(params, "ud",TargetID,Amount)) return SendClientMessage(playerid,Red,"Move up: /up <id>");
if(!IsPlayerConnected(TargetID)) return SendClientMessage(playerid,Red,"Player is not connected");
if(!IsPlayerInAnyVehicle(TargetID))
{
GetPlayerPos(TargetID,X,Y,Z);
SetPlayerPos(TargetID,X,Y,Z+Amount);
}
else
{
GetPlayerPos(TargetID,X,Y,Z);
SetVehiclePos(GetPlayerVehicleID(TargetID),X,Y,Z+Amount);
}
if(isnull(Amount))
{
GetPlayerPos(playerid,X,Y,Z);
SetPlayerPos(playerid,X,Y,Z+10);
return 1;
}
C:\Users\ituni_000\Desktop\Server\gamemodes\Untitled.pwn(318) : error 028: invalid subscript (not an array or too many subscripts): "Amount"
C:\Users\ituni_000\Desktop\Server\gamemodes\Untitled.pwn(318) : error 029: invalid expression, assumed zero
C:\Users\ituni_000\Desktop\Server\gamemodes\Untitled.pwn(318) : error 028: invalid subscript (not an array or too many subscripts): "Amount"
C:\Users\ituni_000\Desktop\Server\gamemodes\Untitled.pwn(318) : fatal error 107: too many error messages on one line
Compilation aborted.Pawn compiler 3.2.3664 Copyright (c) 1997-2006, ITB CompuPhase
4 Errors.
if(Amount == 0)
Runn3R, do you usually read comments? You might've overseen mine. But that's okay, because I'm a ninja when it's past 23:00.
|
CMD:up(playerid,params[])
{
new TargetID, Amount, Float:X,Float:Y,Float:Z;
if(!IsPlayerAdmin(playerid)) return SendClientMessage(playerid,Red,"UnKnown Command! Type /cmds");
if(sscanf(params, "ud",TargetID,Amount)) return SendClientMessage(playerid,Red,"Move up: /up <id>");
if(!IsPlayerConnected(TargetID)) return SendClientMessage(playerid,Red,"Player is not connected");
if(!IsPlayerInAnyVehicle(TargetID))
{
GetPlayerPos(TargetID,X,Y,Z);
SetPlayerPos(TargetID,X,Y,Z+Amount);
}
else
{
GetPlayerPos(TargetID,X,Y,Z);
SetVehiclePos(GetPlayerVehicleID(TargetID),X,Y,Z+Amount);
}
if(Amount == 0)
{
GetPlayerPos(playerid,X,Y,Z);
SetPlayerPos(playerid,X,Y,Z+10);
}
return 1;
}
CMD:up(playerid,params[])*
{*
**new*TargetID,*Amount,*Float:X,Float:Y,Float:Z;*
**if(!IsPlayerAdmin(playerid))*return*SendClientMessage(playerid,Red,"UnKnown*Command!*Type*/cmds");*
**if(sscanf(params,*"uI(10)",TargetID,Amount))*return*SendClientMessage(playerid,Red,"Move*up:*/up*<id>");*
**if(!IsPlayerConnected(TargetID))*return*SendClientMessage(playerid,Red,"Player*is*not*connected");*
**if(!IsPlayerInAnyVehicle(TargetID))*
**{*
****GetPlayerPos(TargetID,X,Y,Z);*
****SetPlayerPos(TargetID,X,Y,Z+Amount);*
**}*
**else*
**{*
****GetPlayerPos(TargetID,X,Y,Z);*
****SetVehiclePos(GetPlayerVehicleID(TargetID),X,Y,Z+Amount);*
}
**return*1;*
}**