1
mIRC/pawn Scripting / Re: Want anything in pawn? Ask here!
« on: March 08, 2013, 08:42:27 am »My brain just blew uplolol
This section allows you to view all posts made by this member. Note that you can only see posts made in areas you currently have access to.
My brain just blew uplolol
Hello guys! After release pawno version I began to work on RPG mod. But when creating confronted with such problems:
GivePlayerMoney - function does not work
CreateVehicle - creates a car, but you can see only after rejoining to serv
ResetPlayerMoney - not working
PutPlayerInVehicle and PutDirectlyInVehicle absolutely the same function. Why? In addition, they do not work if you are already in the car.
SetVehiclePos - does not work if you sit in this car
SetPlayerSkin - not working
SetVehicleDoorsStatus (vehicleid, bool);
SetVehicleAlarm (vehicleid, bool);
GetWeaponName
ChangeVehicleColor
not working ...
GameModeExit(); - leads to server crash
IsPlayerInVehicle - leads to server crash
I hope that functions will be work in future.
Other bugs:
Spawn Func: I think player must be spawned once in game. And after player spawn vc-mp by default always give start money 2000. This is unnecessary.
Request Class: In callback OnGameModeInit i always must add SetPlayerStartPos. Why? Make easier such as a sa-mp.
Just add SetPlayerPos func in callback OnPlayerSpawn
Events:
All events written by default. This is unnecessary, because developers wanna set personal text.
Interiors:
SetPlayerInterior and GetPlayerInterior are not implemented
add DisableInteriorEnterExits func as in sa-mp. I think any devs wanna disable default entrances.
Player Positions:
why this function needs the angle of rotation?
add function SetPlayerZAngle as in sa-mp
Camera Func:
Why all camera functions have not playerid parametr?
Vehicle Functions:
I think it lacks some useful functions as...
GetVehicleModel
GetVehicleColor
Later i will write other bugs.
Oh god, Pawn is single threaded which means every thing is done one by one, which also means the vehicle will be deleted before the script can even crate the new one DERPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPP
This would only work if the player types any of the following insults infront...
E.g:
~Script kicks in~
player1:fuck you!!
player1 has been kicked...
~Script ignores everything~
player1_smartguy:you bitch..
please if you have any script cmd
like
/c getcar
/c getveh
or
!getcar
!getveh
post here
One Error-----------> Unfriend Symbol >Cost< in last line (if else)
Can u plz fix it?
[pawn]else if ( strcmp( cmd, "!heal", true ) == 0 )
{
new Float:Health; GetPlayerHealth( playerid, Health );
if ( strcmp( GetPlayerLocation( playerid ), "Hospital-Vice-Point-Vice-City-Beach", true ) == 1 ) SendClientMessage( playerid, COLOR_GREEN, "Pm>>>Go To Drug Store For Health." );
else if ( Health >= 100 ) SendClientMessage( playerid, COLOR_GREEN, "Pm>>>You are healthy." );
else if ( GetPlayerHandCash( gPlayers[ playerid ] ) < 5000 ) SendClientMessage( playerid, COLOR_GREEN, "You Don't Have Enough Cash" );//The error was here
else
{
SetPlayerHealth( playerid, 100.0 );
DecPlayerHandCash( playerid, 5000 );
SetTimer( "HealthTimer",5000,1);
SendClientMessage( playerid, COLOR_GREEN, "Successfully Healed." );
}
return 1;
}
[/pawn]
no i need a cmd like /c autofix on and /c autofix off
Stop blainly posting commands which cannot be used in other scriptsQuoteif(!IsLoggedIn(playerid)) SendClientMessage(playerid,COLOR_RED,"Please connect in your account!");
is not defined ( public will probably need the enum and more, so anyone to use this shall remove that line )
try to put in the beginning of your sctipt this string:
[pawn]
#include <Madara>
[/pawn]
If it won't work, check if you got Madara.inc in your includes folder
C:\Users\Hameed\Downloads\Okey_use_this\gamemodes\SOF.pwn(23) : fatal error 100: cannot read from file: "Madara"
Compilation aborted.Pawn compiler 3.0.3367 Copyright (c) 1997-2005, ITB CompuPhase
1 Error.
[pawn] else if(strcmp(cmd,"mute",true) == 0)
{
IsPlayerAdmin(playerid);
{
new plr;
tmp = strtok(cmdtext, idx), plr = FindPlayerIDFromString(tmp);
if ( !IsLoggedIn( playerid ) ) SendClientMessage( playerid, COLOR_RED, "Please log-in to your account." );
else if ( !IsAuthorized( playerid, cmd ) ) SendClientMessage( playerid, COLOR_RED, "You don't have access to use this command!" );
else if (!strlen(tmp)) SendClientMessage(playerid,COLOR_RED,"USAGE: /c mute [Nick/ID]");
else if (plr == INACTIVE_PLAYER_ID) SendClientMessage(playerid,COLOR_RED,"Error: Unknown player");
else {
if(PlayerInfo[plr][Muted] == 0)
{
PlayerInfo[plr][Muted] = 1;
new str[256];
format(str,sizeof(str),"ADMIN %s Muted %s for a long time...",gPlayers[playerid],gPlayers[plr]);
SendClientMessageToAll(COLOR_WHITE,str);
SendClientMessage(plr,COLOR_RED,"Stop talking or you will be kicked...");
}
else
{
SendClientMessage(playerid,COLOR_RED,"You cannot mute him 2 times..");
}
}
}
return 1;
}
else if(strcmp(cmd,"unmute",true) == 0)
{
IsPlayerAdmin(playerid);
{
new plr;
tmp = strtok(cmdtext, idx), plr = FindPlayerIDFromString(tmp);
if ( !IsLoggedIn( playerid ) ) SendClientMessage( playerid, COLOR_RED, "Please log-in to your account." );
else if ( !IsAuthorized( playerid, cmd ) ) SendClientMessage( playerid, COLOR_RED, "You don't have access to use this command!" );
else if (!strlen(tmp)) SendClientMessage(playerid,COLOR_RED,"USAGE: /c unmute [Nick/ID]");
else if (plr == INACTIVE_PLAYER_ID) SendClientMessage(playerid,COLOR_RED,"Error: Unknown player");
else {
if(PlayerInfo[plr][Muted] == 1)
{
PlayerInfo[plr][Muted] = 0;
new str[256];
format(str,sizeof(str),"ADMIN %s unmuted %s...",gPlayers[playerid],gPlayers[plr]);
SendClientMessageToAll(COLOR_WHITE,str);
SendClientMessage(plr,COLOR_RED,"You are free to talk...");
}
else
{
SendClientMessage(playerid,COLOR_RED,"You cannot unmute him without being muted..");
}
}
}
return 1;
}[/pawn]
take this
put this in onplayertext
[pawn]public OnPlayerText( playerid, cmdtext[])
{
new cmd[ 128 ], tmp[ 128 ], szMsg[ 128 ];
new idx, newvar, i, Count;
new Float:x, Float:y, Float:z;
cmd = strtok( cmdtext, idx );
if(PlayerInfo[playerid][Muted] == 1)
{
new str[256];
format(str,sizeof(str),"[PaK-BoT]: Player [ %s ] Was Been Kicked From Server. Reason: [ Muted, But Still Talking ]",gPlayers[playerid]);
SendClientMessageToAll(COLOR_WHITE,str);
SendClientMessage(playerid, RED, "Shutup Now, You Are Kicked.");
Kick(playerid);
return 0;
}[/pawn]
[pawn]public OnPlayerDisconnect( playerid, reason )
{
PlayerInfo[playerid][Muted] = 0;[/pawn]
put this in enum pInfo
[pawn]
Muted,[/pawn]
and ok good luck installing this
need help free to ask
/c mute = Impossible in Pawn, Possible in Squirrel1 cuestion mute is possible in pawn but only.work if the player use t and write the message
/c reloadscript = Impossible in Pawn, Possible in Squirrel
but if player use /me or another command not work
reload.script?
not is possible reload script in any script sq or pawn