15.08.2012, 12:29
So this is my first time actually coding anything. I've learnt all I know about PAWN (Not much) off the Wiki, and I tried to script my own command. But there is something wrong, and I have no idea what it is. Could someone tell me how I could fix this?
My code is for a RP server. It's a command for a seatbelt. Basically if someone doesn't do /seatbelt and they crash their car, they lose 10 health, but whenever I compile it I get errors.
Here's the code, could someone tell me what's wrong or what's missing.
And here are the errors I get.
Thanks!
My code is for a RP server. It's a command for a seatbelt. Basically if someone doesn't do /seatbelt and they crash their car, they lose 10 health, but whenever I compile it I get errors.
Here's the code, could someone tell me what's wrong or what's missing.
Код:
#include <a_samp> new gSeatBelt[MAX_PLAYERS]; CMD:SeatBelt(playerid, params[]){ #pragma unused params new name[MAX_PLAYER_NAME]; GetPlayerName(playerid, name, sizeof(name)); new string[128]; new string1[128]; { if(IsPlayerInAnyVehicle(playerid)) { if(gSeatbelt [playerid] == 1) { format(string, sizeof(string), "* %s reaches over and buckles their seatbelt.", name); format(string, sizeof(string), "* Click (( %s ))", playername) ; NearByMessage(playerid, COLOR_PURPLE, string); NearByMessage(playerid, COLOR_PURPLE, string1); else{ if(gSeatbelt [playerid] == 0) { format(string, sizeof(string), "* %s reaches over and unbuckles their seatbelt.", name); format(string, sizeof(string), "* Click (( %s ))", playername) ; NearByMessage(playerid, COLOR_PURPLE, string); NearByMessage(playerid, COLOR_PURPLE, string1); else{ public OnVehicleDamageStausupdate new Float:Health; new Float:VehHealth; GetVehicleHealth(vehicleid, vehHealth); SetPlayerHealth(playerid,-10 vehHealth); return 1; public NearByMessage(playerid, colour, string[]) new Float: PlayerX, Float: PlayerY, Float: PlayerZ; { if(IsPlayerConnectedEx(i) && IsPlayerSpawned(playerid)) { GetPlayerPos(playerid, PlayerX, PlayerY, PlayerZ); if(IsPlayerInRangeOfPoint(playerid, 5, PlayerX, PlayerY, PlayerZ)) { if(GetPlayerVirtualWorld(playerid) == GetPlayerVirtualWorld(i) && GetPlayerInterior(playerid) == GetPlayerInterior(i)) { SendClientMessage(i, colour, string); else { SendClientMessage(playerid, WHITE, "You are not in a vehicle."); } return 1; }
Код:
C:\Users\Cam\Desktop\Pawn\Seatbelt.pwn(32) : warning 203: symbol is never used: "SeatBelt" C:\Users\Cam\Desktop\Pawn\Seatbelt.pwn(32 -- 54) : warning 203: symbol is never used: "gSeatBelt" Pawn compiler 3.2.3664 Copyright © 1997-2006, ITB CompuPhase 2 Warnings.